import request from "@/utils/request";

// 查询合同类别列表
export function listContractCategory(query) {
  return request({
    url: "/contract/ContractCategory/list",
    method: "get",
    params: query,
    handleError: true,
  });
}

// 查询合同类别详细
export function getContractCategory(contractCategoryId) {
  return request({
    url: "/contract/ContractCategory/" + contractCategoryId,
    method: "get",
    handleError: true,
  });
}

/**
 * 新增合同类别
 * @param {*} data
 * @returns
 */
export function addContractCategory(data) {
  return request({
    url: "/contract/ContractCategory",
    method: "post",
    data: data,
  });
}

/**
 * 根据公司id查询合同类别
 * @param {*} data
 * @returns
 */
export function listContractCategorybyBelongingCompanyId(belongingCompanyId) {
  return request({
    url: "/contract/ContractCategory/contractName/" + belongingCompanyId,
    method: "get",
    handleError: true,
  });
}

// 修改合同类别
export function updateContractCategory(data) {
  return request({
    url: "/contract/ContractCategory",
    method: "put",
    data: data,
  });
}

// 删除合同类别
export function delContractCategory(contractCategoryId) {
  return request({
    url: "/contract/ContractCategory/" + contractCategoryId,
    method: "delete",
  });
}
